-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Online DDL: ddl_strategy=direct #7172
Online DDL: ddl_strategy=direct #7172
Conversation
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Documentation in vitessio/website#639 |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Did we intentionally used dd_strategy instead of ddl_strategy?
|
That's just a typo in my comment. Fixed. |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
On the MySQL CLI I've got the same results as above test case. Query OK, 0 rows affected (0.00 sec)
MySQL [commerce]> alter table corder modify order_id int;
+--------------------------------------+
| uuid |
+--------------------------------------+
| fc1d1705_404a_11eb_b95d_0242ac110002 |
+--------------------------------------+
1 row in set (0.00 sec)
MySQL [commerce]>
MySQL [commerce]>
MySQL [commerce]> set @@ddl_strategy='direct';
Query OK, 0 rows affected (0.00 sec)
MySQL [commerce]> alter table corder modify order_id int;
Query OK, 0 rows affected (0.01 sec) But on the command line, I did not get the same output.
|
That's because since this PR was opened, I already merged another PR that removes that log line altogether. If you'd like the log line to appear please let me know. |
I've found the log message useful. I'd like it back. |
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Log message is now restored. |
🙏 request for additional review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
… first ticker Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
…as 'direct' for strategy with options Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
// DDLStrategyGhost requests gh-ost to run the migration | ||
DDLStrategyGhost DDLStrategy = "gh-ost" | ||
// DDLStrategyPTOSC requests pt-online-schema-change to run the migration | ||
DDLStrategyPTOSC DDLStrategy = "pt-osc" | ||
) | ||
|
||
// IsDirect returns true if this strategy is a direct strategy | ||
// A strategy is direct if it's not explciitly one of the online DDL strategies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit pick: explciitly
@@ -232,6 +232,7 @@ func (exec *TabletExecutor) executeSQL(ctx context.Context, sql string, execResu | |||
return nil | |||
} | |||
} | |||
exec.wr.Logger().Infof("Received DDL request. strategy=%+v", schema.DDLStrategyDirect) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it is useful to log the sql
too 🤷♂️
Backport
NO
Status
ready
Description
Following an internal discussion, where @askdba noticed this output:
strategy =
(empty) seems confusing. Up till now, the empty string stood for the "direct" (non-online) DDL strategy.Starting this PR, the dircet (non-online) strategy is named
"direct"
. Consider the following examples:notes:
-ddl_strategy
command line flag isdirect
. An empty value is also interpreted asdirect
.-ddl_strategy
command line flag isdirect
. An empty value is also interpreted asdirect
.Related Issue(s)
Tracking: #6926
Todos
Impacted Areas in Vitess
List general components of the application that this PR will affect: